<!DOCTYPE html>
<html>
<head>
<div th:include="base-libs :: base-libs" ></div>
<title>签约详情</title>
<!-- <div th:include="common/fwb-modal :: fwb-modal" /> -->
<style type="text/css">
.form-table td {
	padding: 1px;
}

.form-table input,select {
	width: 100% !important;
}

.td-text {
	text-align: right;
	background: #f7f9fb;
	width: 90px;
	vertical-align: middle !important;
	color: #666;
}

.td-content {
	vertical-align: middle !important;
}

input,select {
	height: 28px !important;
	line-height: 28px !important;
	padding-left: 4px !important;
	box-sizing: border-box !important;
}

.panel {
	margin: 4px 2px;
}

.panel-header {
	padding: 10px 5px;
	background: #F2F2F2;
}

.panel-body {
	padding-bottom: 2px;
}

.panel-tool span {
	margin-right: 20px;
	font-weight: bold;
	cursor: pointer;
	color: #2AC672;
}

.rqflLi {
	display: inline-block;
	border: 1px solid #D4D4D4;
	vertical-align: middle;
	padding-right: 8px;
	margin-right: 35px;
	margin-bottom: 4px;
	margin-top: 4px;
	width: 170px;
}

.rqflLi label {
	display: inline-block;
	height: 30px;
	padding: 0px 6px;
	margin-right: 4px;
	text-align: center;
	background-color: #f7f9fb;
	border-right: 1px solid #D4D4D4;
}

.switchbutton {
	margin-bottom: 2px;
}

.switchbutton-on {
	background: #1ea15b;
	color: #fff;
}

.fwbLi {
	display: inline-block;
	border: 1px solid #D4D4D4;
	vertical-align: middle;
	padding-right: 8px;
	margin-right: 10px;
	margin-bottom: 4px;
	margin-top: 4px;
}

.fwbLi label {
	display: inline-block;
	height: 30px;
	padding: 0px 6px;
	margin-right: 4px;
	text-align: center;
	background-color: #f7f9fb;
	border-right: 1px solid #D4D4D4;
}

.fwbLi .fwbsx span {
	display: inline-block;
	height: 100%;
	cursor: pointer;
}

.fwbLi input {
	display: inline-block;
	width: 14px !important;
	height: 14px !important;
	vertical-align: middle;
	margin-bottom: 2px;
}

.jtcyCzDiv {
	vertical-align: middle;
	text-align: center;
	/* width: 80px; */
}

.jtcyCzDiv a {
	margin: auto 4px;
	line-height: 28px;
}
.panel,.panel-header,.panel-body{
  	width:100% !important;
}
</style>

<script th:src="'/service/js/jtqy.js'"></script>

<script th:inline="javascript">
	/**读取request中的初始化数据*/
var data = [[${data}]];
</script>
<script type="text/javascript">
	var zydmCache = {};
		var JTQYINFO = StoreCache.removeCache("JTQYXQINFO");//家庭签约数据
		//alert(JSON.stringify(JTQYINFO));
    	var BACKINFO = StoreCache.getCache("BACKINFO");//跳转页面
    	var removeDetailBtn = StoreCache.removeCache("removeDetailBtn");
        $(function() {
        	var _this = $("#qyxxTable");
        	var trOne = _this.children().children().eq(0);
        	trOne.children().eq(1).attr("colspan","3");
        	var html = $("#qyxqzt").html();
        	trOne.append(html);
        	initData();
        });
		/*查询历史记录*/
        function findLsjl(){
            findQyxxLsjl(JTQYINFO.JMXXID);
        }

        function initData(){
        	$("body").data("qyxx",JTQYINFO);
        	$("#QYXXID").val(JTQYINFO.QYXXID);
            //时间格式化
            JTQYINFO.JSSJ = cutDate_YYYYMMDD(JTQYINFO.JSSJ);
            JTQYINFO.SXSJ = cutDate_YYYYMMDD(JTQYINFO.SXSJ);
            JTQYINFO.CSRQ = cutDate_YYYYMMDD(JTQYINFO.CSRQ);
        	var information = qyxxFormatData(JTQYINFO);
            $(".form-control").each(function(){
                var name = $(this).attr("name");
                var value = information[name];
                if($(this).hasClass("isTitle")){
                	$(this).attr("title",value);
                }
                $(this).val(value);
            })
            var jtcy = data.JTCY;
		    if(!StringUtils.isEmpty(jtcy)){
		    	$.each(jtcy,function (index,obj){
		    		JtcyHandler(obj);
		    	})
		    }
        }
      //续约
    	function qyxxXyCz(){
    		//console.log(JTQYINFO);
    		if(JTQYINFO.SFXY == "1"){
    			$.QuickAlert.alertFail({content : "该用户近期已有续约记录！"});
    		}else{
    			StoreCache.setCache("tabIndex", "1");
    			var back = {
    				SUCCESS: "qycx.html",
    				FAIL: "detail.html?to=ydqDetail&JMXXID=" + JTQYINFO.JMXXID 
    			};
    			StoreCache.setCache("XYBACKINFO", back);
    			StoreCache.setCache("JTQYXQINFO", JTQYINFO);
    			location = "xyManager.html?JMXXID=" + JTQYINFO.JMXXID + "&YLJGID=" + JTQYINFO.YLJGID + "&TDID=" + JTQYINFO.TDID;
    		}
    	}
    	
    	/** 导出功能 */
        function downExcel(){
        	$("#exportData").val(JSON.stringify(new Array(JTQYINFO)));
        	$("#exportForm").submit();
        }
    	
        /** 打印协议  */
    	function printXy(){
    		$("#printForm")[0].submit();
    	}
        
    	  //导出功能
       /*  function downExcel(){
        	$("#exportForm").submit();
        } */
    	
    	/**返回回调*/
    	function btnBackHandler()
    	{
    		$.QuickUrlUtils.redirectUrl("qycx.html");
    	}

		/** 时间截取  */
		function cutDate_YYYYMMDD(date){
			if(!StringUtils.isEmpty(date)){
				return date.substring(0,10);
			}else{
				return date;
			}
		}
</script>
</head>
<body class="easyui-layout">
	<div region="north"
		style="height: 41px; border: none; overflow: hidden; background-color: #f9f9f9;">
		<div class="title">
			<h3>签约详情</h3>
		</div>
	</div>
	<div region="center" style="overflow-x: hidden; border: none;">
		<div>
			<div th:include="common/qyxqModelEasy :: qyxqModelEasy"></div>
		</div>
	</div>
	<div region="south"
		style="height: 41px; border: none; overflow: hidden; background-color: #f9f9f9; padding-top: 6px; text-align: center;">
		<!-- <button id="btnDc" class="btn btn-info" type="button"
						onclick="downExcel()">导出</button> -->
		<!-- <button id="btnXy" class="btn btn-info" type="button" onclick="qyxxXyCz()">续约</button> -->
		<button class="btn btn-info" type="button" onclick="btnBackHandler()">返回</button>
	</div>
</body>
<script type="text/html" id="fwbLi">
	<li class="fwbLi">
		<label></label>
		<input class="easyui-switchbutton">
		<span class="fwbsx">
			<span><input type="radio" value="1">个人</span>
			<span><input type="radio" value="2">家庭</span>
		</span>
	</li>
</script>
<script type="text/html" id="cyxxTr">
	<tr class="cyxxTr">
		<td class="td-text">
			<label>身份证号：</label>
		</td>
		<td class="td-content" style="width: 160px;">
			<input type="text" autocomplete="off" name="SFZH" readonly="readonly" 
				   class="form-control">
		</td>
		<td class="td-text">
			<label>成员姓名：</label>
		</td>
		<td class="td-content" style="width: 120px;">
			<input type="text" autocomplete="off" name="XM" readonly="readonly" 
				   class="form-control">
		</td>
		<td class="td-text">
			<label>成员关系：</label>
		</td>
		<td class="td-content" style="width: 160px;">
			<input type="text" autocomplete="off" name="XMMC" readonly="readonly" 
				   class="form-control">
		</td>
		<td class="td-content" style="min-width: 210px;">
			<input type="text" readonly="readonly" name="QYXX" autocomplete="off"
				   class="form-control isTitle" onmouseover="this.title=this.value">
		</td>
		<td>
			<div class="jtcyCzDiv">
				<input name="RYSX" class="form-control" hidden="hidden" >
				<a class="jtcyBtn" action="remove">移除</a>
				<!-- <button class="btn btn-info jtcyBtn" type="button" action="remove">移除</button> -->
			</div>
		</td>
	</tr>
</script>
<script type="text/html" id="qyxqzt">
	<td class="td-text"><label>当前状态：</label></td>
					<td><input type="text" id="QYZT" name="QYZT"
						readonly="readonly" autocomplete="off" style="color:red" 
						class="layui-input form-control"></td>
</script>
</html>
